<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html">
 
<h:head>
    <title>JSF Demo</title>
</h:head>
<h:body>
    <h:outputScript name="jsf.js" library="javax.faces" target="body">
    </h:outputScript>
    <h1>JSF 2.1 Demo</h1>
    <h:form>
 
        <h:inputText id="name" value="#{helloWorldManagedBean.name}">
            <f:ajax render="helloTextOutput" />
        </h:inputText>
 
        <h:commandButton value="Say Hi via Ajax">
            <f:ajax execute="name" render="helloTextOutput" />
        </h:commandButton>
        
        <h:outputText id="helloTextOutput" value="#{helloWorldManagedBean.hello}" />
    </h:form>
 
</h:body>
</html>